using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using RealState.BusinessObjects;
using RealState.DAL;

namespace RealState.BLL
{
	public class UsersAddressBLL
	{
		private UsersAddressDAO _UsersAddressDAO;

		public UsersAddressDAO UsersAddressDAO
		{
			get { return _UsersAddressDAO; }
			set { _UsersAddressDAO = value; }
		}

		public UsersAddressBLL()
		{
			UsersAddressDAO = new UsersAddressDAO();
		}
		public List<UsersAddress> GetUsersAddresss()
		{
			try
			{
				return UsersAddressDAO.GetUsersAddresss();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public UsersAddress GetUsersAddress(int UserId)
		{
			try
			{
				return UsersAddressDAO.GetUsersAddress(UserId);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddUsersAddress(UsersAddress oUsersAddress)
		{
			try
			{
				return UsersAddressDAO.AddUsersAddress(oUsersAddress);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateUsersAddress(UsersAddress oUsersAddress)
		{
			try
			{
				return UsersAddressDAO.UpdateUsersAddress(oUsersAddress);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveUsersAddress(UsersAddress oUsersAddress)
		{
			try
			{
				return UsersAddressDAO.RemoveUsersAddress(oUsersAddress);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveUsersAddress(int UserId)
		{
			try
			{
				return UsersAddressDAO.RemoveUsersAddress(UserId);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<UsersAddress> DeserializeUsersAddresss(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<UsersAddress>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeUsersAddresss(string Path, List<UsersAddress> UsersAddresss)
		{
			try
			{
				GenericXmlSerializer<List<UsersAddress>>.Serialize(UsersAddresss, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
